<!DOCTYPE html>
<html lang="en">

<!-- title -->





<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
  <meta name="author" content="laoduDYM">
  <meta name="renderer" content="webkit">
  <meta name="copyright" content="laoduDYM">
  <meta name="keywords" content="Hexo | laoduDYM">
  <meta name="description" content="">
  <meta http-equiv="Cache-control" content="no-cache">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <title>Spring Cloud Alibaba（一）Nacos 服务注册发现与配置中心 · laoduDYM&#39;s Studio</title>
  <style type="text/css">
    @font-face {
        font-family: 'Oswald-Regular';
        src: url("/font/Oswald-Regular.ttf");
    }

    body {
        margin: 0;
    }

    header,
    footer,
    .back-top,
    .sidebar,
    .container,
    .site-intro-meta,
    .toc-wrapper {
        display: none;
    }

    .site-intro {
        position: relative;
        z-index: 3;
        width: 100%;
        /* height: 50vh; */
        overflow: hidden;
    }

    .site-intro-placeholder {
        position: absolute;
        z-index: -2;
        top: 0;
        left: 0;
        width: calc(100% + 300px);
        height: 100%;
        background: repeating-linear-gradient(-45deg, #444 0, #444 80px, #333 80px, #333 160px);
        background-position: center center;
        transform: translate3d(-226px, 0, 0);
        animation: gradient-move 2.5s ease-out 0s infinite;
    }

    @keyframes gradient-move {
        0% {
            transform: translate3d(-226px, 0, 0);
        }
        100% {
            transform: translate3d(0, 0, 0);
        }
    }

</style>

  <link rel="preload" href="/css/style.css?v=20180824" as="style"
    onload="this.onload=null;this.rel='stylesheet'" />
  <link rel="stylesheet" href="/css/mobile.css?v=20180824" media="(max-width: 980px)">
  
  <link rel="preload" href="/css/jquery.fancybox.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'" />
  
  <!-- /*! loadCSS. [c]2017 Filament Group, Inc. MIT License */
/* This file is meant as a standalone workflow for
- testing support for link[rel=preload]
- enabling async CSS loading in browsers that do not support rel=preload
- applying rel preload css once loaded, whether supported or not.
*/ -->
<script>
(function( w ){
	"use strict";
	// rel=preload support test
	if( !w.loadCSS ){
		w.loadCSS = function(){};
	}
	// define on the loadCSS obj
	var rp = loadCSS.relpreload = {};
	// rel=preload feature support test
	// runs once and returns a function for compat purposes
	rp.support = (function(){
		var ret;
		try {
			ret = w.document.createElement( "link" ).relList.supports( "preload" );
		} catch (e) {
			ret = false;
		}
		return function(){
			return ret;
		};
	})();

	// if preload isn't supported, get an asynchronous load by using a non-matching media attribute
	// then change that media back to its intended value on load
	rp.bindMediaToggle = function( link ){
		// remember existing media attr for ultimate state, or default to 'all'
		var finalMedia = link.media || "all";

		function enableStylesheet(){
			link.media = finalMedia;
		}

		// bind load handlers to enable media
		if( link.addEventListener ){
			link.addEventListener( "load", enableStylesheet );
		} else if( link.attachEvent ){
			link.attachEvent( "onload", enableStylesheet );
		}

		// Set rel and non-applicable media type to start an async request
		// note: timeout allows this to happen async to let rendering continue in IE
		setTimeout(function(){
			link.rel = "stylesheet";
			link.media = "only x";
		});
		// also enable media after 3 seconds,
		// which will catch very old browsers (android 2.x, old firefox) that don't support onload on link
		setTimeout( enableStylesheet, 3000 );
	};

	// loop through link elements in DOM
	rp.poly = function(){
		// double check this to prevent external calls from running
		if( rp.support() ){
			return;
		}
		var links = w.document.getElementsByTagName( "link" );
		for( var i = 0; i < links.length; i++ ){
			var link = links[ i ];
			// qualify links to those with rel=preload and as=style attrs
			if( link.rel === "preload" && link.getAttribute( "as" ) === "style" && !link.getAttribute( "data-loadcss" ) ){
				// prevent rerunning on link
				link.setAttribute( "data-loadcss", true );
				// bind listeners to toggle media back
				rp.bindMediaToggle( link );
			}
		}
	};

	// if unsupported, run the polyfill
	if( !rp.support() ){
		// run once at least
		rp.poly();

		// rerun poly on an interval until onload
		var run = w.setInterval( rp.poly, 500 );
		if( w.addEventListener ){
			w.addEventListener( "load", function(){
				rp.poly();
				w.clearInterval( run );
			} );
		} else if( w.attachEvent ){
			w.attachEvent( "onload", function(){
				rp.poly();
				w.clearInterval( run );
			} );
		}
	}


	// commonjs
	if( typeof exports !== "undefined" ){
		exports.loadCSS = loadCSS;
	}
	else {
		w.loadCSS = loadCSS;
	}
}( typeof global !== "undefined" ? global : this ) );
</script>

  <link rel="icon" href="/assets/addrimg.png" />
  <link rel="preload" href="/scripts/webfontloader.min.js" as="script" />
  <link rel="preload" href="/scripts/jquery.min.js" as="script" />
  <link rel="preload" href="/scripts/main.js" as="script" />
  <link rel="preload" as="font" href="/font/Oswald-Regular.ttf" crossorigin>
  <link rel="preload" as="font" href="/font/font_327081_1dta1rlogw17zaor.woff" crossorigin>
  <!-- fancybox -->
  <script src="/scripts/jquery.fancybox.min.js" defer></script>
  <!-- 百度统计  -->
  
  <!-- 谷歌统计  -->
  
<meta name="generator" content="Hexo 4.2.1"><link rel="alternate" href="/atom.xml" title="Hexo" type="application/atom+xml">
</head>


  <body class="post-body">
    
        
<header class="header">

    <div class="read-progress"></div>
    <div class="header-sidebar-menu">&#xe775;</div>
    <!-- post页的toggle banner  -->
    
    <div class="banner">
            <div class="blog-title">
                <a href="/" >laoduDYM&#39;s Studio.</a>
            </div>
            <div class="post-title">
                <a href="#" class="post-name">Spring Cloud Alibaba（一）Nacos 服务注册发现与配置中心</a>
            </div>
    </div>
    
    <a class="home-link" href=/>laoduDYM's Studio.</a>
</header>
        <div class="wrapper">
          <div class="site-intro" style="







height:50vh;
">
  
  <!-- 主页  -->
  
  
  <!-- 404页  -->
  
  <div class="site-intro-placeholder"></div>
  <div class="site-intro-img" style="background-image: url(/intro/post-bg.jpg)"></div>
  <div class="site-intro-meta">
    <!-- 标题  -->
    <h1 class="intro-title">
      <!-- 主页  -->
      
      Spring Cloud Alibaba（一）Nacos 服务注册发现与配置中心
      <!-- 404 -->
      
    </h1>
    <!-- 副标题 -->
    <p class="intro-subtitle">
      <!-- 主页副标题  -->
      
      
      <!-- 404 -->
      
    </p>
    <!-- 文章页meta -->
    
    <div class="post-intros">
      <!-- 文章页标签  -->
      
      <div class= post-intro-tags >
    
        <a class="post-tag" href="javascript:void(0);" data-tags = "微服务">微服务</a>
    
</div>
      
      
      <div class="post-intro-read">
        <span>Word count: <span
            class="post-count word-count">307</span>Reading time: <span
            class="post-count reading-time">1 min</span></span>
      </div>
      
      <div class="post-intro-meta">
        <span class="post-intro-calander iconfont-archer">&#xe676;</span>
        <span class="post-intro-time">2020/07/01</span>
        
        <span id="busuanzi_container_page_pv" class="busuanzi-pv">
          <span class="iconfont-archer">&#xe602;</span>
          <span id="busuanzi_value_page_pv"></span>
        </span>
        
        <span class="shareWrapper">
          <span class="iconfont-archer shareIcon">&#xe71d;</span>
          <span class="shareText">Share</span>
          <ul class="shareList">
            <li class="iconfont-archer share-qr" data-type="qr">&#xe75b;
              <div class="share-qrcode"></div>
            </li>
            <li class="iconfont-archer" data-type="weibo">&#xe619;</li>
            <li class="iconfont-archer" data-type="qzone">&#xe62e;</li>
            <li class="iconfont-archer" data-type="twitter">&#xe634;</li>
            <li class="iconfont-archer" data-type="facebook">&#xe67a;</li>
          </ul>
        </span>
      </div>
    </div>
    
  </div>
</div>
          <script>

  // get user agent
  var browser = {
    versions: function () {
      var u = window.navigator.userAgent;
      return {
        userAgent: u,
        trident: u.indexOf('Trident') > -1, //IE内核
        presto: u.indexOf('Presto') > -1, //opera内核
        webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
        gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
        mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
        ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
        android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
        iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者安卓QQ浏览器
        iPad: u.indexOf('iPad') > -1, //是否为iPad
        webApp: u.indexOf('Safari') == -1, //是否为web应用程序，没有头部与底部
        weixin: u.indexOf('MicroMessenger') == -1, //是否为微信浏览器
        uc: u.indexOf('UCBrowser') > -1 //是否为android下的UC浏览器
      };
    }()
  }
  console.log("userAgent:" + browser.versions.userAgent);

  // callback
  function fontLoaded() {
    console.log('font loaded');
    if (document.getElementsByClassName('site-intro-meta')) {
      document.getElementsByClassName('intro-title')[0].classList.add('intro-fade-in');
      document.getElementsByClassName('intro-subtitle')[0].classList.add('intro-fade-in');
      var postIntros = document.getElementsByClassName('post-intros')[0]
      if (postIntros) {
        postIntros.classList.add('post-fade-in');
      }
    }
  }

  // UC不支持跨域，所以直接显示
  function asyncCb() {
    if (browser.versions.uc) {
      console.log("UCBrowser");
      fontLoaded();
    } else {
      WebFont.load({
        custom: {
          families: ['Oswald-Regular']
        },
        loading: function () {  //所有字体开始加载
          // console.log('loading');
        },
        active: function () {  //所有字体已渲染
          fontLoaded();
        },
        inactive: function () { //字体预加载失败，无效字体或浏览器不支持加载
          console.log('inactive: timeout');
          fontLoaded();
        },
        timeout: 5000 // Set the timeout to two seconds
      });
    }
  }

  function asyncErr() {
    console.warn('script load from CDN failed, will load local script')
  }

  // load webfont-loader async, and add callback function
  function async(u, cb, err) {
    var d = document, t = 'script',
      o = d.createElement(t),
      s = d.getElementsByTagName(t)[0];
    o.src = u;
    if (cb) { o.addEventListener('load', function (e) { cb(null, e); }, false); }
    if (err) { o.addEventListener('error', function (e) { err(null, e); }, false); }
    s.parentNode.insertBefore(o, s);
  }

  var asyncLoadWithFallBack = function (arr, success, reject) {
    var currReject = function () {
      reject()
      arr.shift()
      if (arr.length)
        async(arr[0], success, currReject)
    }

    async(arr[0], success, currReject)
  }

  asyncLoadWithFallBack([
    "/scripts/webfontloader.min.js",
    "/scripts/webfontloader.js",
    "/lib/webfontloader.min.js"
  ], asyncCb, asyncErr)
</script>
          <img class="loading" src="/assets/loading.svg"
            style="display: block; margin: 6rem auto 0 auto; width: 6rem; height: 6rem;" />
          <div class="container container-unloaded">
            <main class="main post-page">
  <article class="article-entry">
    <h3 id="Nacos-下载与启动"><a href="#Nacos-下载与启动" class="headerlink" title="Nacos 下载与启动"></a>Nacos 下载与启动</h3><blockquote>
<p>中文手册</p>
</blockquote>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https:&#x2F;&#x2F;nacos.io&#x2F;zh-cn&#x2F;index.html</span><br></pre></td></tr></table></figure>

<blockquote>
<p>下载页面</p>
</blockquote>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https:&#x2F;&#x2F;github.com&#x2F;alibaba&#x2F;nacos&#x2F;releases</span><br></pre></td></tr></table></figure>

<h3 id="spring-cloud-集成"><a href="#spring-cloud-集成" class="headerlink" title="spring cloud 集成"></a>spring cloud 集成</h3><blockquote>
<p>引入依赖  注：本文 Nacos 版本为 1.3</p>
</blockquote>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">&#39;com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-config&#39;    &#x2F;&#x2F;配置中心</span><br><span class="line">&#39;com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery&#39; &#x2F;&#x2F;服务注册发现</span><br></pre></td></tr></table></figure>
<a id="more"></a>

<blockquote>
<p>配置文件 bootstrap.yml</p>
</blockquote>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">spring:</span></span><br><span class="line">  <span class="attr">cloud:</span></span><br><span class="line">    <span class="attr">nacos:</span></span><br><span class="line">      <span class="attr">config:</span></span><br><span class="line">        <span class="attr">server-addr:</span> <span class="number">127.0</span><span class="number">.0</span><span class="number">.1</span><span class="string">:8848</span></span><br><span class="line">        <span class="attr">file-extension:</span> <span class="string">yml</span>  <span class="comment">#配置文件格式</span></span><br><span class="line">      <span class="attr">discovery:</span></span><br><span class="line">        <span class="attr">server-addr:</span>  <span class="number">127.0</span><span class="number">.0</span><span class="number">.1</span><span class="string">:8848</span></span><br></pre></td></tr></table></figure>
<h3 id="启动类"><a href="#启动类" class="headerlink" title="启动类"></a>启动类</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">@EnableDiscoveryClient &#x2F;&#x2F;开启服务注册发现</span><br></pre></td></tr></table></figure>

<h3 id="Nacos-服务端创建配置文件"><a href="#Nacos-服务端创建配置文件" class="headerlink" title="Nacos 服务端创建配置文件"></a>Nacos 服务端创建配置文件</h3><blockquote>
<p>在 Nacos Spring Cloud 中，dataId 的完整格式如下：</p>
</blockquote>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$&#123;prefix&#125;-$&#123;spring.profile.active&#125;.$&#123;file-extension&#125;</span><br></pre></td></tr></table></figure>

<ul>
<li><p>prefix 默认为 spring.application.name 的值，也可以通过配置项 spring.cloud.nacos.config.prefix来配置。</p>
</li>
<li><p>spring.profile.active 即为当前环境对应的 profile，详情可以参考 Spring Boot文档。 注意：当 spring.profile.active 为空时，对应的连接符 - 也将不存在，dataId 的拼接格式变成 ${prefix}.${file-extension}</p>
</li>
<li><p>file-exetension 为配置内容的数据格式，可以通过配置项 spring.cloud.nacos.config.file-extension 来配置。目前只支持 properties 和 yaml 类型</p>
</li>
<li><p>注： 当 spring.profile.active 为空时，dataId 可以简写为 ${prefix}</p>
</li>
</ul>

  </article>
  <! -- 添加捐赠图标 -->
  <div class="post-donate">
    <div id="donate_guide" class="donate_bar center hidden">
      <!-- 方式一： 
                ![](/img/Alipay.jpg)
                ![](/img/WeChatpay.jpg)
            -->
      <!-- 方式二；
                step1：在_config.yml中添加配置
                    Alipay: /img/Alipay.jpg
                    WeChatpay: /img/WeChatpay.jpg
                step2：此处两张图片的路径分别设置为如下
                    <img src=""
                    <img src=""
            -->
      <!-- 支付宝打赏图案 -->
      <!-- <img src="/avatar/addrimg.png" alt="支付宝打赏"> -->
      <!-- 微信打赏图案 -->
      <img src="/avatar/weixin_pay.jpg" alt="微信打赏">
    </div>
    <div id="donate_board" class="donate_bar center">
      <a id="btn_donate" class="btn_donate" href="javascript:;" title="打赏"></a>
      <span class="donate_txt">
        ↑<br>
        欣赏此文?求鼓励，求支持!
      </span>
      <br>
    </div>

    <script type="text/javascript">
      var btnFlag = true;
      document.getElementById('btn_donate').onclick = function () {
        //$('#donate_board').addClass('hidden');
        if (btnFlag) {
          $('#donate_guide').removeClass('hidden');
          btnFlag = false;
        } else {
          $('#donate_guide').addClass('hidden');
          btnFlag = true;
        }

      }
    </script>
  </div>
  <! -- 添加捐赠图标 -->
    <style type="text/css">
      .donate_bar {
        text-align: center;
        margin-top: 5%
      }

      .donate_bar a.btn_donate {
        display: inline-block;
        width: 82px;
        height: 82px;
        margin-left: auto;
        margin-right: auto;
        background: url(/avatar/btn_reward.gif)no-repeat;
        -webkit-transition: background 0s;
        -moz-transition: background 0s;
        -o-transition: background 0s;
        -ms-transition: background 0s;
        transition: background 0s
      }

      .donate_bar a.btn_donate:hover {
        background-position: 0 -82px
      }

      .donate_bar .donate_txt {
        display: block;
        color: #9d9d9d;
        font: 14px/2 "Microsoft Yahei"
      }

      .donate_bar.hidden {
        display: none
      }

      .post-donate {
        margin-top: 80px;
      }

      #donate_guide {
        height: 210px;
        width: 420px;
        margin: 0 auto;
      }

      #donate_guide img {
        height: 200px;
        height: 200px;
      }
    </style>

  <!-- license  -->
  
  <div class="license-wrapper">
    <p>本文作者：<a href="http://laodudym.gitee.io">laoduDYM</a>
    <p>原文链接：<a href="http://laodudym.gitee.io/2020/07/01/Spring-Cloud-Alibaba%EF%BC%88%E4%B8%80%EF%BC%89Nacos-%E6%9C%8D%E5%8A%A1%E6%B3%A8%E5%86%8C%E5%8F%91%E7%8E%B0%E4%B8%8E%E9%85%8D%E7%BD%AE%E4%B8%AD%E5%BF%83/">http://laodudym.gitee.io/2020/07/01/Spring Cloud Alibaba（一）Nacos 服务注册发现与配置中心</a>
    <p>发表日期：<a href="http://laodudym.gitee.io/2020/07/01/Spring-Cloud-Alibaba%EF%BC%88%E4%B8%80%EF%BC%89Nacos-%E6%9C%8D%E5%8A%A1%E6%B3%A8%E5%86%8C%E5%8F%91%E7%8E%B0%E4%B8%8E%E9%85%8D%E7%BD%AE%E4%B8%AD%E5%BF%83/">2020-07-01 16:09:54</a>
    <p>更新日期：<a href="http://laodudym.gitee.io/2020/07/01/Spring-Cloud-Alibaba%EF%BC%88%E4%B8%80%EF%BC%89Nacos-%E6%9C%8D%E5%8A%A1%E6%B3%A8%E5%86%8C%E5%8F%91%E7%8E%B0%E4%B8%8E%E9%85%8D%E7%BD%AE%E4%B8%AD%E5%BF%83/">2020-07-01 16:34:38</a>
    <p>版权声明：本文采用<a rel="license noopener" href="http://creativecommons.org/licenses/by-nc/4.0/" target="_blank">知识共享署名-非商业性使用 4.0 国际许可协议</a>进行许可</p>
  </div>
  
  <!-- paginator  -->
  <ul class="post-paginator">
    <li class="next">
      
      <div class="nextSlogan">Next Post</div>
      <a href="/2020/07/01/Mave%E3%80%81-Gradle-%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/" title="Mave、 Gradle 安装与配置">
        <div class="nextTitle">Mave、 Gradle 安装与配置</div>
      </a>
      
    </li>
    <li class="previous">
      
      <div class="prevSlogan">Previous Post</div>
      <a href="/2020/06/23/MySql%E7%BB%BF%E8%89%B2%E7%89%88%E5%AE%89%E8%A3%85%E4%BB%A5%E5%8F%8A%E5%B8%B8%E7%94%A8%E8%AF%AD%E5%8F%A5/" title="MySql绿色版安装以及常用语句">
        <div class="prevTitle">MySql绿色版安装以及常用语句</div>
      </a>
      
    </li>
  </ul>
  <!-- 评论插件 -->
  
<div id="giteement-ctn"></div>

<!-- <link rel="stylesheet" href="https://giteement.oss-cn-beijing.aliyuncs.com/wd-discuss.css"> -->
<!-- <script src="https://giteement.oss-cn-beijing.aliyuncs.com/discuss_hexo.js"></script> -->
<!-- <link rel="stylesheet" href="https://giteement.oss-cn-beijing.aliyuncs.com/default.css">
<script src="https://giteement.oss-cn-beijing.aliyuncs.com/giteement.browser.js"></script> -->
<link rel="stylesheet" href="/css/default.css">
<script src="/scripts/giteement.browser.js"></script>

<script>
  var giteement = new Giteement({
    id: '20200701160954',
    owner: 'laoduDYM',
    repo: 'laodudym',
    backcall_uri: 'https://laodudym.gitee.io',
    oauth_uri: 'https://cors-anywhere.herokuapp.com/https://gitee.com/oauth/token',
    oauth: {
      client_id: '6e3fdf239039a3b0de03689f36209e2bb38781ef7939ffdd1b8279ca7acbff0f',
      client_secret: 'c2f7f35f7f08c41323534c6cc534120d9668beae39fc90166af53202e4659bb4'
    },
  })
  giteement.render('giteement-ctn')
</script>

  <!-- 评论 -->
</main>
            <!-- profile -->
            
          </div>
          <footer class="footer footer-unloaded">
    <!-- social  -->
    
    <div class="social">
        



<a href="mailto:dymiam@163.com" class="iconfont-archer email" title=email></a>





<a href="//github.com/laoduDYM" class="iconfont-archer github" target="_blank" title=github></a>





<a href="//gitee.com/laoduDYM" class="iconfont-archer gitee" target="_blank" title=gitee></a>





<span class="iconfont-archer wechat" title=wechat>
  
  <img class="profile-qr" src="/intro/weixin.jpg" />
</span>



































<a href="/atom.xml" class="iconfont-archer rss" target="_blank" title=rss></a>








    </div>
    
    <!-- powered by Hexo  -->
    <div class="copyright">
        <span id="hexo-power">Powered by <a href="https://hexo.io/" target="_blank">Hexo</a></span><span class="iconfont-archer power">&#xe635;</span><span id="theme-info">theme <a href="https://github.com/fi3ework/hexo-theme-archer" target="_blank">Archer</a></span>
    </div>
    <!-- 不蒜子  -->
    
    <div class="busuanzi-container">
    
     
    <span id="busuanzi_container_site_pv">PV: <span id="busuanzi_value_site_pv"></span> :)</span>
    
    </div>
    
</footer>
        </div>
        <!-- toc -->
        
        <div class="toc-wrapper" style=







top:50vh;
>
          <div class="toc-catalog">
            <span class="iconfont-archer catalog-icon">&#xe613;</span><span>CATALOG</span>
          </div>
          <ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#Nacos-下载与启动"><span class="toc-number">1.</span> <span class="toc-text">Nacos 下载与启动</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#spring-cloud-集成"><span class="toc-number">2.</span> <span class="toc-text">spring cloud 集成</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#启动类"><span class="toc-number">3.</span> <span class="toc-text">启动类</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Nacos-服务端创建配置文件"><span class="toc-number">4.</span> <span class="toc-text">Nacos 服务端创建配置文件</span></a></li></ol>
        </div>
        
        <div class="back-top iconfont-archer">&#xe639;</div>
        <div class="sidebar sidebar-hide">
    <ul class="sidebar-tabs sidebar-tabs-active-0">
        <li class="sidebar-tab-archives"><span class="iconfont-archer">&#xe67d;</span><span class="tab-name">Archive</span></li>
        <li class="sidebar-tab-tags"><span class="iconfont-archer">&#xe61b;</span><span class="tab-name">Tag</span></li>
        <li class="sidebar-tab-categories"><span class="iconfont-archer">&#xe666;</span><span class="tab-name">Cate</span></li>
    </ul>
    <div class="sidebar-content sidebar-content-show-archive">
          <div class="sidebar-panel-archives">
    <!-- 在ejs中将archive按照时间排序 -->
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    <div class="widget">
        <div id="search-form">
            <div id="result-mask" class="hide"></div>
            <div class="search-area" >
                <span class="iconfont-archer  search-icon search-icon-my ">&#xe627;</span>
                    <input id="search-key" type="text" autocomplete="off" placeholder="请输入要搜索的内容..." class="search-input-my">
                     <button type="button" class="search-form-submit hide" id="search-local" ></button>
   
            </div>
            <div id="result-wrap" class="hide">
                <div id="search-result"></div>
            </div>
             <div class="hide">
                <template id="search-tpl">
                    <div class="item">
                        <a href="/{path}" title="{title}">
                            <div class="title">{title}</div>
                            <div class="content">{content}</div>
                        </a>
                    </div>
                </template>
            </div> 
        </div>
    </div>
    <div class="total-and-search">
        <div class="total-archive">
        Total : 5
        </div>
        <!-- search  -->
        <!-- 
            <div class="site-search popup-trigger">
                <span class="iconfont-archer search-icon">&#xe627;</span>
            </div>
         -->

        

    </div>
    
    <div class="post-archive">
    
    
    
    
    <div class="archive-year"> 2020 </div>
    <ul class="year-list">
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">07/01</span><a class="archive-post-title" href= "/2020/07/01/Mave%E3%80%81-Gradle-%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/" >Mave、 Gradle 安装与配置</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">07/01</span><a class="archive-post-title" href= "/2020/07/01/Spring-Cloud-Alibaba%EF%BC%88%E4%B8%80%EF%BC%89Nacos-%E6%9C%8D%E5%8A%A1%E6%B3%A8%E5%86%8C%E5%8F%91%E7%8E%B0%E4%B8%8E%E9%85%8D%E7%BD%AE%E4%B8%AD%E5%BF%83/" >Spring Cloud Alibaba（一）Nacos 服务注册发现与配置中心</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">06/23</span><a class="archive-post-title" href= "/2020/06/23/MySql%E7%BB%BF%E8%89%B2%E7%89%88%E5%AE%89%E8%A3%85%E4%BB%A5%E5%8F%8A%E5%B8%B8%E7%94%A8%E8%AF%AD%E5%8F%A5/" >MySql绿色版安装以及常用语句</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">06/22</span><a class="archive-post-title" href= "/2020/06/22/npm%E5%B8%B8%E7%94%A8%E6%93%8D%E4%BD%9C/" >npm常用操作</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">06/22</span><a class="archive-post-title" href= "/2020/06/22/GIT%E5%B8%B8%E7%94%A8%E6%93%8D%E4%BD%9C/" >GIT常用操作</a>
        </li>
    
    </div>
  </div>
        <div class="sidebar-panel-tags">
    <div class="sidebar-tags-name">
    
        <span class="sidebar-tag-name" data-tags="mysql"><span class="iconfont-archer">&#xe606;</span>mysql</span>
    
        <span class="sidebar-tag-name" data-tags="git"><span class="iconfont-archer">&#xe606;</span>git</span>
    
        <span class="sidebar-tag-name" data-tags="maven"><span class="iconfont-archer">&#xe606;</span>maven</span>
    
        <span class="sidebar-tag-name" data-tags="gradle"><span class="iconfont-archer">&#xe606;</span>gradle</span>
    
        <span class="sidebar-tag-name" data-tags="微服务"><span class="iconfont-archer">&#xe606;</span>微服务</span>
    
        <span class="sidebar-tag-name" data-tags="npm"><span class="iconfont-archer">&#xe606;</span>npm</span>
    
    </div>
    <div class="iconfont-archer sidebar-tags-empty">&#xe678;</div>
    <div class="tag-load-fail" style="display: none; color: #ccc; font-size: 0.6rem;">
    缺失模块。<br/>
    1、请确保node版本大于6.2<br/>
    2、在博客根目录（注意不是archer根目录）执行以下命令：<br/>
    <span style="color: #f75357; font-size: 1rem; line-height: 2rem;">npm i hexo-generator-json-content --save</span><br/>
    3、在根目录_config.yml里添加配置：
    <pre style="color: #787878; font-size: 0.6rem;">
jsonContent:
  meta: false
  pages: false
  posts:
    title: true
    date: true
    path: true
    text: false
    raw: false
    content: false
    slug: false
    updated: false
    comments: false
    link: false
    permalink: false
    excerpt: false
    categories: true
    tags: true</pre>
    </div> 
    <div class="sidebar-tags-list"></div>
</div>
        <div class="sidebar-panel-categories">
    <div class="sidebar-categories-name">
    
    </div>
    <div class="iconfont-archer sidebar-categories-empty">&#xe678;</div>
    <div class="sidebar-categories-list"></div>
</div>
    </div>
</div> 
        <script>
    var siteMeta = {
        root: "/",
        author: "laoduDYM"
    }
</script>
        <!-- CDN failover -->
        <script src="/scripts/jquery.min.js"></script>
        <script type="text/javascript">
          if (typeof window.$ === 'undefined') {
            console.warn('jquery load from jsdelivr failed, will load local script')
            document.write('<script src="/lib%20/%20jquery.min.js">\x3C/script>')
          }
        </script>
        <script src="/scripts/main.js"></script>
        <!-- algolia -->
        
        <div class="site-search">
  <div class="algolia-popup popup">
    <div class="algolia-search">
      <div class="algolia-search-input-icon">
        <i class="fa fa-search"></i>
      </div>
      <div class="algolia-search-input" id="algolia-search-input"></div>
    </div>

    <div class="algolia-results">
      <div id="algolia-stats"></div>
      <div id="algolia-hits"></div>
      <div id="algolia-pagination" class="algolia-pagination"></div>
    </div>

    <span class="popup-btn-close">
      <i class="iconfont-archer">&#xe609;</i>
    </span>
  </div>
</div>
        <script src="/scripts/instantsearch.min.js" defer></script>
        <script src="/scripts/search.js" defer></script>
        
        <!-- busuanzi  -->
        
        <script async src="/scripts/busuanzi.pure.mini.js"></script>
        
        <!-- CNZZ  -->
        
        </div>
        <!-- async load share.js -->
        
        <script src="/scripts/share.js" async></script>
        
      </body>

</html>